//
//  MeHeadView.m
//  RainbowFM
//
//  Created by jv on 14-12-6.
//  Copyright (c) 2014年 RB. All rights reserved.
//

#import "MeHeadView.h"
#import <UIImageView+WebCache.h>

@implementation MeHeadView

- (void)awakeFromNib
{
    [super awakeFromNib];
    
    
    //圆形头像
    UIBezierPath *path = [UIBezierPath bezierPathWithArcCenter:CGPointMake(_headImageView.width / 2.f, _headImageView.width / 2.f) radius:_headImageView.width / 2.f startAngle:-M_PI endAngle:M_PI clockwise:YES];
    CAShapeLayer *layer = [CAShapeLayer layer];
    layer.path = [path CGPath];
    _headImageView.layer.mask = layer;
    //圆形背景
    path = [UIBezierPath bezierPathWithArcCenter:CGPointMake(_headCircleView.width / 2.f, _headCircleView.width / 2.f) radius:_headCircleView.width / 2.f startAngle:-M_PI endAngle:M_PI clockwise:YES];
    layer = [CAShapeLayer layer];
    layer.path = [path CGPath];
    _headCircleView.layer.mask = layer;
    
#warning todo
    [_headImageView sd_setImageWithURL:[NSURL URLWithString:@"http://img0.bdstatic.com/img/image/shouye/mntsc2-12893142236.jpg"] placeholderImage:nil];
}


/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
